Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warm up done #237

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

warm up done #237

wants to merge 1 commit into from

Conversation

siderdk
Copy link
Collaborator

@siderdk siderdk commented Mar 20, 2025

Apologies for the dealy n2🙏

Copy link

@Niloufar97 Niloufar97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job

//GET /documents/:id
app.get('/documents/:id', (req, res) => {
const id = req.params.id;
const result = documents.find(document => document.id == id); //I know I need to parse the id and stick to string equality. but this is just a warm up. can I get away with this?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like your comment😄
yes, you can do anything you want.

let result;

//when only fields is provided
if (fields) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if...else works better here

if(fields){
   //code
} else if(query){
   //code
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants